import java.awt.Color;
import java.rmi.RemoteException;

import javax.swing.GroupLayout;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.LayoutStyle;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;

/**
 * This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
 * Builder, which is free for non-commercial use. If Jigloo is being used
 * commercially (ie, by a corporation, company or business for any purpose
 * whatever) then you should purchase a license for each developer using Jigloo.
 * Please visit www.cloudgarden.com for details. Use of Jigloo implies
 * acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
 * PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
 * ANY CORPORATE OR COMMERCIAL PURPOSE.
 */
public class ClientApplication extends javax.swing.JFrame {
	private InteractingBoard drawingSurface;
	private ClientInputPanel inputSurface;

	private WhiteBoardClient client;

	/**
	 * Auto-generated main method to display this JFrame
	 * @throws RemoteException 
	 */
	// public static void main(String[] args) {
	// SwingUtilities.invokeLater(new Runnable() {
	// public void run() {
	// ClientApplication inst = new ClientApplication();
	// inst.setLocationRelativeTo(null);
	// inst.setVisible(true);
	// }
	// });
	// }

	public static void main(String args[]) throws RemoteException {
		WhiteBoardClient c = new WhiteBoardClient();
		ClientApplication ca = new ClientApplication(c);
		// JFrame f = new JFrame(title);
//		ca.setAlwaysOnTop(true);
		ca.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		ca.setSize(400, 400);
     	if(args.length >= 2){
    		ca.setLocation(Integer.valueOf(args[0]).intValue(),Integer.valueOf(args[1]).intValue());
     	}
		
		ca.setVisible(true);
	}

	public ClientApplication() {
		super();

	}

	public ClientApplication(WhiteBoardClient c) {
		super();
		client = c;
		
		drawingSurface = client.getBoard();
		inputSurface = new ClientInputPanel(client);
		JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
				drawingSurface, inputSurface);
		this.add(splitPane);
		splitPane.setDividerLocation(200);
//		initGUI();

	}


}
